package com.woniuxy.joylifeshop.service.serviceImpl;

import com.woniuxy.common.entity.ShopCommodityType;
import com.woniuxy.common.mapper.ShopCommodityTypeMapper;
import com.woniuxy.joylifeshop.service.CommodityTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class CommodityTypeServiceImpl implements CommodityTypeService {

    @Autowired
    ShopCommodityTypeMapper shopCommodityTypeMapper;

    /**
    * @Author SooYoo
    * @Description
    * @Param
    * @Return
    **/
    @Override
    public String checkShopCommodityType(ShopCommodityType shopCommodityType) {

        if (shopCommodityType.getTypeId()!=null || !shopCommodityType.getTypeId().equals("")) {
            ShopCommodityType shopCommodityTypeReality = shopCommodityTypeMapper.selectByPrimaryKey(shopCommodityType.getTypeId());
            if (shopCommodityTypeReality!=null ){
                return "通过";
            }else{
                return "未找到";
            }
        }
        return "前端传出为空";
    }
}
